package hotel.meituan.oversea.biz.controller;

import hotel.base.oversea.utils.Result;
import hotel.meituan.oversea.biz.service.MtHotelDetailService;
import hotel.meituan.oversea.biz.service.MtHotelService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 美团酒店信息Controller
 * @author qiuyy
 * @date 2020-05-15
 */
@Slf4j
@RestController
@RequestMapping("/meituanOperReids")
@Api(value = "MtHotelController", tags = {"美团酒店接口"})
public class MeituanOperReidsController {
    @Autowired
    private MtHotelService mtHotelService;

    @Autowired
    private MtHotelDetailService mtHotelDetailService;

    @PostMapping("/resetMtHotelIdsRedis")
    @ApiOperation(value = "根据库表数据重置美团ids缓存",notes="必须经过auth授权")
    public Result<Object> resetMtHotelIdsRedis(){
        return  mtHotelService.findAllHotelIdsPutRedis();
    }

    @PostMapping("/resetMtHotelDetailRedis")
    @ApiOperation(value = "根据库表数据重置美团酒店详情缓存",notes="必须经过auth授权")
    public Result<Object> resetMtHotelDetailRedis(){
        return  mtHotelDetailService.findAllHotelDetailPutRedis();
    }


}
